from django.db import models
from utils.BaseModel import BaseModel
# Create your models here.
class Nav(BaseModel): # 导航栏
    name = models.CharField(max_length=10, verbose_name='导航栏名称')
    position= models.IntegerField(verbose_name='导航栏位置',default=0)#0 头  1 尾
    link=models.CharField(max_length=100,verbose_name='导航栏链接',default='')
    class Meta:
        db_table = 'fgnav'
    def __str__(self):
        return self.name
class Banner(BaseModel): # 轮播图
    title= models.CharField(max_length=50,verbose_name='轮播图标题')
    img = models.ImageField(upload_to='banner/',verbose_name='轮播图图片')
    link = models.CharField(max_length=100,verbose_name='轮播图链接',default='')
    class Meta:
        db_table = 'banner'
    def __str__(self):
        return self.title
